var p1=new Promise((resolve,reject)=>{
    console.log('异步请求开始啦-----------------')
    //发送异步请求
    var request=new XMLHttpRequest();
    request.open("get",'http://47.106.244.1:8099/manager/category/findAllCategory')
    request.setRequestHeader('Accept','application/json');
    request.send();
    request.onreadystatechange=function(){
        if(request.readyState==4){
            if(request.status===200){
                console.log('请求成功')
                resolve(request.response)//调用resolve
            }else{
                console.log('请求失败')
                reject(request.status);//调用reject
            }
        }
    }
})
p1.then(function(data){//声明resolve和reject函数
    console.log('success:',data);
},function(data){
    console.log('error:',data);
})